const Sequelize = require('sequelize');

module.exports = conn => {
    // 用户
    let Admin = conn.define('Admin', {
        // 用户名
        username: {
            type: Sequelize.STRING(),
            allowNull: false
        },
        // md5密码
        password: {
            type: Sequelize.STRING(),
            allowNull: false
        },
        lastLoginDate: {
            type: Sequelize.DATE,
            allowNull: false,
            defaultValue: Sequelize.NOW
        },
        // 是否删除
        deleted: {
            type: Sequelize.BOOLEAN,
            allowNull: false,
            defaultValue: false,
        }

    }, {
        tableName: 'admins'
    });

    return Admin;
}